/*
 * Copyright (c) 2018. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.gov.dna.base.service;


import com.gov.dna.base.entity.BaseNode;
import com.gov.dna.base.mybatis.BasePage;

import java.util.List;

/**
 * 节点基础类 用于处理子父层级
 * @author (作者) Dong Jie 154046519@qq.com
 * @version V1.0
 * @date 2018/12/7 10:58
 * @since (该版本支持的JDK版本) 1.8
 */
public interface BaseNodeService<T extends BaseNode> extends BaseService<T> {

    /**
     * 根据查询结果数据构建树形结构
     * @author (作者) Dong Jie 154046519@qq.com
     * @param o
     * @return java.util.List<T>
     * @date 2019/1/6 16:26
     */
    List<T> buildTree(T o) throws InstantiationException, IllegalAccessException;

    /**
     * 查询结果构建懒加载树
     * @author (作者) Dong Jie 154046519@qq.com
     * @param o
     * @param page
     * @return com.gov.dna.base.mybatis.BasePage<T>
     * @date 2019/1/6 19:51
     */
    BasePage<T> buildLazyTree(T o, BasePage<T> page) throws IllegalAccessException, InstantiationException;
}
